package com.web_bloks.mvc.client;

/**
 * 
 * @author Jean-Lou Dupont
 *
 */
public class Notification implements INotification {

	// the name of the notification instance
	// the type of the notification instance
	private String name = null, type = null;

	// the body of the notification instance
	private NotificationBody body = null;

	public Notification() {
		super();
	}
	
	public Notification( String name, NotificationBody body, String type ) {
		super();
		this.name = name;
		this.body = body;
		this.type = type;
	}
	
	public void init( String name, NotificationBody body, String type ) {
		this.name = name;
		this.body = body;
		this.type = type;		
	}

	/**
	 * GETTER Body
	 */
	public NotificationBody getNotificationBody() {
		return body;
	}

	/**
	 * GETTER Name
	 */
	public String getNotificationName() {
		return name;
	}

	/**
	 * GETTER Type
	 */
	public String getNotificationType() {
		return type;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public void setNotificationType(String type) {
		this.type = type;
	}
	

	public void setNotificationBody(NotificationBody body) {
		this.body = body;
	}

	public String toString( )
	{
		String result = "Notification Name: " + getNotificationName() + " Body: ";
		if (this.body != null) {
			result += this.body.toString() + " type: ";
		} else {
			result += "null type: ";
		}
		if (this.type != null) {
			result += result;
		} else {
			result += "null ";
		}
		return result;
	}

}//END